#include<iostream>
#include<string>
//成对使用功能new 和 delete 时要采用相同形式
typedef std::string AddressLines[4];
std::string str;

int main()
{
    //错误示范:
    // std::string* str_ptr = new std::string[100];
    // delete str_ptr;//会资源泄露,其余99个string没有调用析构函数,发段错误
    std::string*ptr = new AddressLines;//此时的动作就像: new string[4]一样
    ptr[1] = "hello world";
    ptr[2] = "ni hao a";
    std::string*ptr2 = &str;
    return 0;
}